<?php
/**
 * Project: firework-cms             >>  http://firework-cms.googlecode.com
 * Authors: YouniS Ben Salah  (-.-)  >>  http://younishd.kegtux.org
 *          Fabien Wang       (^.^)  >>  http://fabienwang.fr
 * License: See README and LICENSE in the top level directory
 */
/**
 * Snippet: side_menu ( generic )
 * Required data:
 *      + elements ( PDOStatement object )
 *          + elements::link
 *          + elements::text
 */
?>
<nav id="side_menu">
    <ul>
    <?php
    while ( $element = $this->data['elements']->fetch() ) {
        if ( $element['link'] == '' ) {
            echo '<li><span class="element_group">' . $element['text'] . '</span></li>';
        }
        else {
            if ($element['target'] <> '') {
                echo '<li><a href="' . $element['link'] . '" target="'.$element['target'].'">' . $element['text'] . '</a></li>';
            }
            else {
                echo '<li><a href="' . $element['link'] . '">' . $element['text'] . '</a></li>';
            }
        }
    }
    ?>
    </ul>
</nav>
<?php
